package Administrator.AdministratorMainFrame.AdministratorMainFrameView;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.JFormattedTextField;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.border.EtchedBorder;
import javax.swing.border.LineBorder;

import Administrator.AdministratorMainFrame.AdministratorMainFrameView.ConfigureContestPane.*;

import Administrator.AdministratorMainFrame.AdministratorMainFrameView.RunContestPane.*;

public class AdministratorMainFrameView 
{	
	private JFormattedTextField defaultAnswerFormattedTextField;
	private JFormattedTextField contestTitleFormattedTextField;
	public JFrame frame;
	public JButton exitButton;
	
	private ConfigureContestPane configureContestPane;
	private RunContestPane runContestPane;
	/**
	 * Launch the application
	 * @param args
	 */
	public static void main(String args[]) 
	{
		try
		{
		    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
		
		EventQueue.invokeLater(new Runnable() 
		{
			public void run() {
				try {
					AdministratorMainFrameView window = new AdministratorMainFrameView();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application
	 */
	public AdministratorMainFrameView() 
	{
		try
		{
		    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
		createContents();
		
		frame.setVisible(true);
	}

	/**
	 * Initialize the contents of the frame
	 */
	private void createContents() 
	{
		frame = new JFrame();
		frame.getContentPane().setFont(new Font("", Font.BOLD, 12));
		frame.getContentPane().setLayout(null);
		frame.setTitle("Administrator Main Frame");
		frame.setBounds(100, 100, 854, 591);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		final JLabel administratorSystemLabel = new JLabel();
		administratorSystemLabel.setForeground(new Color(255, 0, 0));
		administratorSystemLabel.setFont(new Font("", Font.BOLD, 14));
		administratorSystemLabel.setText("Administrator System");
		administratorSystemLabel.setBounds(282, 10, 221, 26);
		frame.getContentPane().add(administratorSystemLabel);

		final JLabel statusLabel = new JLabel();
		statusLabel.setText("Status");
		statusLabel.setBounds(0, 10, 66, 31);
		frame.getContentPane().add(statusLabel);

		final JLabel stoppedLabel = new JLabel();
		stoppedLabel.setText("Stopped");
		stoppedLabel.setBounds(45, 16, 66, 18);
		frame.getContentPane().add(stoppedLabel);

		exitButton = new JButton();
		exitButton.setText("Exit");
		exitButton.setBounds(666, 12, 99, 23);
		frame.getContentPane().add(exitButton);

		final JTabbedPane tabbedPane = new JTabbedPane();
		tabbedPane.setBounds(0, 45, 846, 514);
		frame.getContentPane().add(tabbedPane);
			
		configureContestPane = new ConfigureContestPane();
	
		tabbedPane.addTab("Configure Contest", null, configureContestPane, null);
        
		runContestPane = new RunContestPane();	
		tabbedPane.addTab("Run Contest", null, runContestPane, null);
	}
	public ConfigureContestPane getConfigureContestPane()
	{
		return this.configureContestPane;
	}
	public RunContestPane getRunContestPane()
	{
		return this.runContestPane;
	}
}
